Skip to main content

Transfer Order API - Asset

Version 1.0 — May 2024

Authentication - Login API

To access the GraphQL APIs, users must first authenticate using the Xemelgo Login REST API.

Endpoint Details

  • URL: https://rest.api.xemelgo.com/login
  • Method: POST

Properties

PropertyTypeDescriptionRequired
emailStringbase64 Encoded email id for userYes
passwordStringbase64 encoded password for userYes

Password needs to be a minimum of 8 characters and should have a number in it.

Request Body

{
"email": "base64_encoded_email",
"password": "base64_encoded_password"
}

StatusCode - 200 on success

Response Body

{
"AccessToken": "$accessToken",
"ExpiresIn": 480,
"TokenType": "Bearer",
"RefreshToken": "$refreshToken",
"IdToken": "$idToken"
}

Use the $idToken as the authorization header for all API requests.

Errors

ErrorError codeException
In correct username and/or password400NotAuthorizedException

Create Asset Transfer Order API

Create Asset Transfer Order API allows to create the transfer order and keep track of the items associated with the transfer order.

Endpoint Details

  • URL: https://api.xemelgo.com/graphql
  • Method: POST

Properties

PropertyTypeDescriptionRequired
idStringTransfer order numberYes
transferFromIdStringSource locationNo
transferToIdStringDestination locationNo
entriesArrayList of assets and their quantities (view table below)Yes
customPropertiesAWSJSONAdditional properties applicable to transfer ordersNo

entries

PropertyTypeDescriptionRequired
assetIdStringAsset identifierYes
totalQuantityNumberQuantity of the assetYes
trackerSerialsArray of StringList of EPCs for the asset as part of the transfer orderNo
unitStringUnit of measure (if applicable)No

Headers

Authorization – $idToken

Request Body

mutation createAssetTransferOrder {
createAssetTransferOrder(
input: CreateAssetTransferOrderInput!
) {
assetTransferOrder {
cancelledDate
creationDate
id
receiveDate
startDate
transferFrom {
customProperties
description
id
name
}
status
lastUpdatedDate
entries {
lastUpdatedDate
asset {
customProperties
description
name
id
}
inventory {
trackerSerial
id
name
description
}
inTransitQuantity
receivedQuantity
unit
totalQuantity
}
transferTo {
customProperties
description
id
name
}
}
}
}
----------------------------------------------------------------------

CreateAssetTransferOrderInput {
transferFromId: "Location A",
transferToId: "Location B",
entries: [
{
assetId: "Asset-123",
totalQuantity: 3,
trackerSerials: ["EPC1", "EPC2", "EPC3"],
unit: "EA"
}
],
id: "TEST_ASSET_TRANSFER_ORDER"
}

Status Code - 200

Response Body

AssetTransferOrder {
id: String
status: TransferOrderStatus
transferFrom: LocationV2
transferTo: LocationV2
creationDate: AWSTimestamp
startDate: AWSTimestamp
completedDate: AWSTimestamp
cancelledDate: AWSTimestamp
entries: [AssetTransferOrderEntry!]!
lastUpdatedDate: AWSTimestamp
customProperties: AWSJSON
}

Errors

ErrorError codeException
Expired token401Unauthorized
Invalid token401Unauthorized
Missing Authorization Header401Unauthorized

Error Response Examples

Expired Token

{
"errors": [
{
"errorType": "UnauthorizedException",
"message": "Token has expired."
}
]
}

Invalid token

{
"errors": [
{
"errorType": "UnauthorizedException",
"message": "Unable to parse JWT token"
}
]
}

Missing Authorization Header

{
"errors": [
{
"errorType": "UnauthorizedException",
"message": "User is not authorized to make this call."
}
]
}

Additional 200-Level Errors

ErrorError descriptionError code
ValidationErrorNo id provided, no entries, quantity ≤ 0, no asset, duplicate asset200
ResourceNotFoundErrorTracker serial does not exist200
UnexpectedErrorSome unexpected things happened on create, duplicate locations with the same identifier200
LocationNotFoundErrorFrom/to location not found200
ResourceAlreadyExistErrorTransfer order with this identifier already exists200

Get Transfer Order API

Get Transfer Order API allows to retrieve the transfer order and view its status.

Endpoint Details

  • URL: https://api.xemelgo.com/graphql
  • Method: POST

Properties

PropertyTypeDescriptionRequired
idStringTransfer order numberYes

Headers

Authorization – $idToken

Request Body

query assetTransferOrder($id: String) {
assetTransferOrder(input: { id: $id }) {
assetTransferOrder {
cancelledDate
creationDate
id
receivedDate
startDate
transferFrom {
customProperties
description
id
name
}
status
lastUpdatedDate
entries {
lastUpdatedDate
asset {
customProperties
description
id
name
}
inventory {
trackerSerial
id
name
description
}
inTransitQuantity
receivedQuantity
unit
totalQuantity
}
transferTo {
customProperties
description
id
name
}
}
}
}

Status Code - 200

Response Body

AssetTransferOrder {
id: String
status: TransferOrderStatus
transferFrom: LocationV2
transferTo: LocationV2
creationDate: AWSTimestamp
startDate: AWSTimestamp
completedDate: AWSTimestamp
cancelledDate: AWSTimestamp
entries: [AssetTransferOrderEntry!]!
lastUpdatedDate: AWSTimestamp
customProperties: AWSJSON
}

Errors

ErrorError codeException
Expired token401Unauthorized
Invalid token401Unauthorized
Missing Authorization Header401Unauthorized

Error Response Examples

Expired Token

{
"errors": [
{
"errorType": "UnauthorizedException",
"message": "Token has expired."
}
]
}

Invalid token

{
"errors": [
{
"errorType": "UnauthorizedException",
"message": "Unable to parse JWT token"
}
]
}

Missing Authorization Header

{
"errors": [
{
"errorType": "UnauthorizedException",
"message": "User is not authorized to make this call."
}
]
}

Additional 200-Level Errors

ErrorError descriptionError code
ValidationErrorNo id provided200
ResourceNotFoundErrorTransfer order not found200

List Transfer Orders API

List Transfer Orders API allows to retrieve all the transfer orders and view their statuses.

Endpoint Details

  • URL: https://api.xemelgo.com/graphql
  • Method: POST

Properties

PropertyTypeDescriptionRequired
filterStringFilter for transfer order propertiesNo
nextTokenStringPagination supportNo

Headers

Authorization – $idToken

Request Body

query assetTransferOrders($filter: String, $nextToken: String) {
assetTransferOrders(input: { filter: $filter, nextToken: $nextToken }) {
assetTransferOrders {
cancelledDate
creationDate
id
receivedDate
startDate
transferFrom {
customProperties
description
id
name
}
status
lastUpdatedDate
entries {
lastUpdatedDate
asset {
customProperties
description
id
name
}
inventory {
trackerSerial
id
name
description
}
inTransitQuantity
receivedQuantity
unit
totalQuantity
}
transferTo {
customProperties
description
id
name
}
}
}
}

Status Code - 200

Response Body

AssetTransferOrder {
id: String
status: TransferOrderStatus
transferFrom: LocationV2
transferTo: LocationV2
creationDate: AWSTimestamp
startDate: AWSTimestamp
completedDate: AWSTimestamp
cancelledDate: AWSTimestamp
entries: [AssetTransferOrderEntry]!
lastUpdatedDate: AWSTimestamp
customProperties: AWSJSON
}

Errors

ErrorError codeException
Expired token401Unauthorized
Invalid token401Unauthorized
Missing Authorization Header401Unauthorized

Error Response Examples

Expired Token

{
"errors": [
{
"errorType": "UnauthorizedException",
"message": "Token has expired."
}
]
}

Invalid token

{
"errors": [
{
"errorType": "UnauthorizedException",
"message": "Unable to parse JWT token"
}
]
}

Missing Authorization Header

{
"errors": [
{
"errorType": "UnauthorizedException",
"message": "User is not authorized to make this call."
}
]
}

Delete Transfer Order API

Delete Transfer Order API allows to remove the transfer order.

Endpoint Details

  • URL: https://api.xemelgo.com/graphql
  • Method: POST

Properties

PropertyTypeDescriptionRequired
idStringTransfer order numberYes

Headers

Authorization – $idToken

Request Body

mutation deleteAssetTransferOrder {
deleteAssetTransferOrder(input: { id: "TEST_ASSET_TRANSFER_ORDER" }) {
assetTransferOrder {
cancelledDate
creationDate
id
receivedDate
startDate
transferFrom {
customProperties
description
id
name
}
status
lastUpdatedDate
entries {
lastUpdatedDate
asset {
customProperties
description
id
name
}
inventory {
trackerSerial
id
name
description
}
inTransitQuantity
receivedQuantity
unit
totalQuantity
}
transferTo {
customProperties
description
id
name
}
}
}
}

Status Code - 200

Response Body

AssetTransferOrder {
id: String
status: TransferOrderStatus
transferFrom: LocationV2
transferTo: LocationV2
creationDate: AWSTimestamp
startDate: AWSTimestamp
completedDate: AWSTimestamp
cancelledDate: AWSTimestamp
entries: [AssetTransferOrderEntry!]!
lastUpdatedDate: AWSTimestamp
customProperties: AWSJSON
}

Errors

ErrorError codeException
Expired token401Unauthorized
Invalid token401Unauthorized
Missing Authorization Header401Unauthorized

Error Response Examples

Expired Token

{
"errors": [
{
"errorType": "UnauthorizedException",
"message": "Token has expired."
}
]
}

Invalid token

{
"errors": [
{
"errorType": "UnauthorizedException",
"message": "Unable to parse JWT token"
}
]
}

Missing Authorization Header

{
"errors": [
{
"errorType": "UnauthorizedException",
"message": "User is not authorized to make this call."
}
]
}

Additional 200-Level Errors

ErrorError descriptionError code
ValidationErrorNo id provided200
ResourceNotFoundErrorTransfer order not found200